# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-gvm
_pkgname=${pkgname/py3/python}
pkgver=22.6.1
pkgrel=0
pkgdesc="Greenbone Vulnerability Management Python Library "
url="https://github.com/greenbone/python-gvm"
arch="noarch"
license="GPL-3.0"
makedepends="py3-build py3-installer py3-poetry-core"
checkdepends="py3-defusedxml py3-pytest py3-lxml py3-paramiko"
source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/$_pkgname/archive/v${pkgver/_/.}.tar.gz"
builddir="$srcdir/$_pkgname-${pkgver/_/.}"

build() {
	# XXX: hack for poetry to not ignore files
	GIT_DIR=. python3 -m build --no-isolation --wheel
}

check() {
	python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/python_gvm-$pkgver-py3-none-any.whl
}

sha512sums="
d40e5ac3508fd3205eaf41dabaf1f57dbf7fc0deaeaa6a82e326f5c7cf844b5d2a7785e5b1e8b1ccf1b04980c420b4f566a7860a9f4a7fcc9feb54426e9b089b  py3-gvm-22.6.1.tar.gz
"
